package com.sangfor.ssl.service.https;

import java.io.IOException;
import java.io.InputStream;
import kotlin.UByte;

/* loaded from: classes2.dex */
final class HttpInputStream extends InputStream {
    private static final String TAG = "HttpInputStream";
    private final long mNativeInputStreamPtr;

    private static native int readInputStreamNative(long j, byte[] bArr, int i, int i2);

    @Override // java.io.InputStream
    public boolean markSupported() {
        return false;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public HttpInputStream(long j) {
        this.mNativeInputStreamPtr = j;
    }

    @Override // java.io.InputStream
    public int read() throws IOException {
        byte[] bArr = new byte[1];
        if (read(bArr, 0, 1) != -1) {
            return bArr[0] & UByte.MAX_VALUE;
        }
        return -1;
    }

    @Override // java.io.InputStream
    public int read(byte[] bArr, int i, int i2) throws IOException {
        return readInputStreamNative(this.mNativeInputStreamPtr, bArr, i, i2);
    }
}
